<div class="layui-body">
	<div class="aright">
	<div class="arz cl"><a href="{:url('man/reach/add')}"><i class="layui-icon">&#xe608;</i>添加域名</a></div>
	<form method="post" class="aform cl" >
	<table width="100%">
	      <tr>

			<th width="5%" align="center">ID编号</th>
	        <th width="8%" align="center">域名名称</th>
	
	        <th width="4%" align="center">状态</th>
			<th width="4%" align="center">总浏览数</th>
			<th width="4%" align="center">浏览数</th>
			<th width="6%" align="center">导量域名</th>
			<th width="8%" align="center">开始时间</th>
			<th width="8%" align="center">结束时间</th>
	        <th width="15%" align="center">基本操作</th>
	      </tr>
	      {volist name="list" id="vo"}
		  <tr>
			<td align="center">{$vo.id}</td>
	        <td align="center">{$vo.domain}</td>
	
			<td align="center">
				{if condition="$vo['status'] eq 1"}
				<span style="color:#00f;">正在运行</span>
				{elseif condition="$vo['status'] eq 2"}
				<span style="color:#0f0;">导量中...</span>
				{elseif condition="$vo['status'] eq 3"}
				<span style="color:#f00;">黑名单</span>
				{/if}</td>
			<td align="center">{$vo.cou}</td>
			<td align="center">{$vo.num}</td>
			<td align="center">{$vo.denp_domain|default="没有域名"}</td>
			<td align="center">{$vo.start_time}</td>
			<td align="center">{$vo.end_time}</td>
	        <td align="center">
	        	<a style="cursor:pointer;" onclick="change({$vo.id},5)">重新导量</a> |
	        	{if condition="$vo['status'] eq 1"}
	        	<a  style="cursor:pointer;" onclick="change({$vo.id},2)">设为导量中</a> | <a style="cursor:pointer;" onclick="change({$vo.id},3)">设为黑名单</a>
				{elseif condition="$vo['status'] eq 2"}
				<a  style="cursor:pointer;" onclick="change({$vo.id},1)">设为正在运行</a> | <a style="cursor:pointer;" onclick="change({$vo.id},3)">设为黑名单</a>
				{elseif condition="$vo['status'] eq 3"}
				<a  style="cursor:pointer;" onclick="change({$vo.id},1)">设为正在运行</a> | <a style="cursor:pointer;" onclick="change({$vo.id},2)">设为导量中</a>
				{/if}
	        	| <a href="{:url('man/reach/delete',array('id'=>$vo['id']))}" onclick="return confirm('您确定设为不显示吗？');">隐藏</a>
	        </td>
	      </tr>
	      {/volist}
	 </table>

	 </form>
	 		<div class="pages">
 				{$list->render()}
	 	 	</div>
	</div>
	</div>
</div>
<script>
layui.use('layer',function(){
	var layer = layui.layer;
})
function change(aid,status){
	$.post("{:url('man/reach/change')}",{'aid':aid,'status':status},function(data){
		if(data){
			layer.msg("修改成功");
			setTimeout(function(){
				window.location.reload();
			},1000);
			
		}else{
			layer.msg("修改失败");
		}
	})
}

$("input[name=province]").blur(function(){
	var province = $(this).val();
	var nid=$(this).attr('data-id');
	$.post("{:url('man/reach/cblur')}",{'aid':nid,'province':province},function(data){
		if(data){
			layer.msg("修改成功");
			setTimeout(function(){
				window.location.reload();
			},1000);
			
		}
	})
	 
})

</script>